package com.dkd.sbtz.domain.vo;

import com.dkd.common.annotation.Excel;
import lombok.Data;

import java.math.BigDecimal;
import java.util.List;

@Data
public class RouteCreateDTO {
    private Long startParentId;   // 起始父节点ID（0或null表示根）
    private Boolean reuseCode;    // 命中编码是否自动复用（自动加 -1/-2）
    private List<Layer> layers;
    private SystemInfo systemInfo;


    @Data
    public static class Layer {
        private String nodeType;  // 必填：asset_node.node_type
        private String name;      // 必填
        private String parentName;
        private String code;      // 选填：唯一，若空则由你自己规则生成或不校验
        private Long spareId;     // 选填：若不填则不建关联
        private String remark;    // 选填：备注写到节点 & 关联表
        private String specification;
        private String model;
        private String material;
        private String power;
        private String brand;
        private String manufacturer;
        private Integer isSpecial = 0;
        private Integer deptId;
        private Integer status = 0;
        private List<Long> spareIds;

        private String mokuai;
        private String area;
        private String beType;
        private String designTemp;
        private String designPress;
        private String motorPower;
        private String mixingType;
        private String unit;
        private Integer quantity;
        private BigDecimal amount;



        private List<SpareRelation> spareRelations;
        private List<SpareCustom> spareCustom;
        private List<Layer> children;
    }

    @Data
    public static class SpareRelation {
        private Long spareId;     // 关联备件id
        private String vendor;    // 厂商
        private String spec;      // 规格
        private BigDecimal qtyNeed; // 数量
        private Integer isPrimary;  // 是否主要备件（0/1）
        private String remark;      // 备注
    }

    @Data
    public static class SpareCustom {
        private String code;
        private String name;
        private BigDecimal amount;
        private String spareClass;
        private List<SpareDetail> spareDetails;
    }

    @Data
    public static class SpareDetail {
        private String vendor;
        private String spec;
    }

    @Data
    public static class SystemInfo {
        private String name;
        private String code;
        private Integer isKey;  // 是否关键系统（0/1）
    }

}
